package com.sysware.studio;


import java.io.*;
import java.util.*;
import java.util.List;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.program.Program;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;

import com.sysware.bean.TreeBean;


public class MainTree extends ViewPart {
	
	public final static String ID = "com.sysware.studio.MainTree";
	
	private TreeViewer tree;//树
	
	@Override
	public void createPartControl(Composite parent) {
		final Tree tree = new Tree(parent, SWT.BORDER | SWT.SINGLE);
	 
		TreeItem root = new TreeItem(tree, SWT.NULL);
		root.setImage(ImageFactory.loadImage(Display.getCurrent(),"icon-data-root.png"));
		root.setText("菜单");
		
		
		TreeItem n1 = new TreeItem(root, SWT.NULL);
		n1.setImage(ImageFactory.loadImage(Display.getCurrent(),"icon-completed-project.png"));
		n1.setText("系统管理");
		TreeItem n11 = new TreeItem(n1, SWT.NULL);
		n11.setImage(ImageFactory.loadImage(Display.getCurrent(),"icon-data-system.png"));
		n11.setText("菜单");
		
		TreeItem n2 = new TreeItem(root, SWT.NULL);
		n2.setImage(ImageFactory.loadImage(Display.getCurrent(),"icon-completed-project.png"));
		n2.setText("应用字典");
		
		TreeItem n3001 = new TreeItem(n2, SWT.NULL);
		n3001.setImage(ImageFactory.loadImage(Display.getCurrent(),"icon-data-system.png"));
		n3001.setText("实体类型");
		
		TreeItem n3 = new TreeItem(n2, SWT.NULL);
		n3.setImage(ImageFactory.loadImage(Display.getCurrent(),"icon-data-system.png"));
		n3.setText("元素");
		
		TreeItem n33 = new TreeItem(n2, SWT.NULL);
		n33.setImage(ImageFactory.loadImage(Display.getCurrent(),"icon-data-system.png"));
		n33.setText("字段组");
		
		TreeItem n333 = new TreeItem(n2, SWT.NULL);
		n333.setImage(ImageFactory.loadImage(Display.getCurrent(),"icon-data-system.png"));
		n333.setText("引用");
		
		TreeItem n4 = new TreeItem(n2, SWT.NULL);
		n4.setImage(ImageFactory.loadImage(Display.getCurrent(),"icon-data-system.png"));
		n4.setText("表和列");
		
		TreeItem n5 = new TreeItem(n2, SWT.NULL);
		n5.setImage(ImageFactory.loadImage(Display.getCurrent(),"icon-data-system.png"));
		n5.setText("窗口、页签&字段");
		
		TreeItem n5001 = new TreeItem(n2, SWT.NULL);
		n5001.setImage(ImageFactory.loadImage(Display.getCurrent(),"icon-data-system.png"));
		n5001.setText("消息");
		
		n2.setExpanded(true);
		root.setExpanded(true);
	}
	
	
	@Override
	public void setFocus() {
		
	}
}
